package com.sg.dto.integration.app;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @desc WorkTaskDto
 * @使用场景
 */
@Data
public class WorkTaskDto extends BaseDto implements Serializable {

    /**
     * 任务ID
     */
    @ApiModelProperty("任务ID")
    private String taskId;

    /**
     * 任务编号
     */
    @ApiModelProperty("任务编号")
    private String taskNumber;

    /**
     * 任务名称
     */
    @ApiModelProperty("任务名称")
    private String taskName;

    /**
     * 计划开始时间
     */
    @ApiModelProperty("计划开始时间")
    private Date planStartTime;

    /**
     * 计划结束时间
     */
    @ApiModelProperty("计划结束时间")
    private Date planEndTime;

    /**
     * 前端偏差语义提示
     */
    @ApiModelProperty("前端偏差语义提示")
    private String deflectionInfo;

    /**
     * 冗余最新进度
     */
    @ApiModelProperty("冗余最新进度")
    private Double percentageProgress;

    /**
     * 总时长
     */
    @ApiModelProperty("总时长")
    private Long totalLength;

    /**
     * 相关人数量
     */
    @ApiModelProperty("相关人数量")
    private Long relevantPeopleNum;

    /**
     * 归属主体排序
     */
    @ApiModelProperty("归属主体排序")
    private Long orderNumber;

    /**
     * 操作时间
     */
    @ApiModelProperty("操作时间")
    private Date operateTime;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private Date createTime;

    /**
     * 前端偏差时间
     */
    @ApiModelProperty("前端偏差时间")
    private Long deflectionTime;

    /**
     * 任务进展状态 NOT_AT_THE:未开始 ONGOING:进行中 OVERDUE:已逾期 HAS_ENDED:已结束
     */
    @ApiModelProperty("任务进展状态")
    private String taskStatus;

    /**
     * 工作任务类型筛选条件
     */
    @ApiModelProperty("工作任务类型筛选条件")
    private String workTaskType;

    /**
     * 是否完成 TRUE:是 FALSE:否
     */
    @ApiModelProperty("是否完成")
    private String isComplete;

    /**
     * 是否逾期 TRUE:是 FALSE:否
     */
    @ApiModelProperty("是否逾期")
    private String isOverdue;

    /**
     * 主体生命周期 CURRENTLY_VALID:当前有效 EDITING:正在编辑 ARCHIVING:历史存档
     */
    @ApiModelProperty("主体生命周期")
    private String subjectLifeCycle;

    /**
     * 来源类型编码
     */
    @ApiModelProperty("来源类型编码")
    private String sourceTypeCode;

    /**
     * 任务简介
     */
    @ApiModelProperty("任务简介")
    private String taskDesc;

    /**
     * 安排主体ID
     */
    @ApiModelProperty("安排主体ID")
    private String arrangeSubjectId;

    /**
     * 安排主体类型编码 OMS_ORG_ORGANIZATION:组织表 OMS_ORG_DEPT:部门表
     */
    @ApiModelProperty("安排主体类型编码")
    private String arrangeSubjectTypeCode;

    /**
     * 接收部门ID
     */
    @ApiModelProperty("接收部门ID")
    private String receiveSubjectId;

    /**
     * 归属对象ID
     */
    @ApiModelProperty("归属对象ID")
    private String coordObjectId;

    /**
     * 内容冗余状态 EDITING:草稿 TOBESIGN:待签收 ONGOING:进行中 FAILED:已失败 OVERDUE:逾期任务 NOT_AT_THE:未开始 UNCOMPLETED:未完成 COMPLETED:已完成 UNREPORTED:待汇报 EVA:评价中 AUDIT:审核中 SUCCESS:已成功 EXPIRED:已逾期 UNLIMITED:不限
     */
    @ApiModelProperty("内容冗余状态")
    private String stateCode;

    /**
     * 完成情况 AHEAD_SCHEDULE:提前完成（提前24h） NORMAL_COMPLETE:正常完成 OVERDUE_COMPLETE:逾期完成
     */
    @ApiModelProperty("完成情况")
    private String completeStatus;

    /**
     * 原计划开始时间
     */
    @ApiModelProperty("原计划开始时间")
    private Date oriPlanStartTime;

    /**
     * 原计划结束时间
     */
    @ApiModelProperty("原计划结束时间")
    private Date oriPlanEndTime;

    /**
     * 任务类型 ROUTINE_TASK:常规任务 PROJECT_TASK:项目任务 TEMPORARY_TASK:临时任务 PROBLEM_TASK:问题任务
     */
    @ApiModelProperty("任务类型")
    private String taskType;

    /**
     * 创建人就职记录ID
     */
    @ApiModelProperty("创建人就职记录ID")
    private String createInductionId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        WorkTaskDto that = (WorkTaskDto) o;
        return (
                taskId == that.taskId &&
                        taskNumber == that.taskNumber &&
                        taskName == that.taskName &&
                        planStartTime == that.planStartTime &&
                        planEndTime == that.planEndTime &&
                        deflectionInfo == that.deflectionInfo &&
                        percentageProgress == that.percentageProgress &&
                        totalLength == that.totalLength &&
                        relevantPeopleNum == that.relevantPeopleNum &&
                        orderNumber == that.orderNumber &&
                        operateTime == that.operateTime &&
                        createTime == that.createTime &&
                        deflectionTime == that.deflectionTime &&
                        taskStatus == that.taskStatus &&
                        workTaskType == that.workTaskType &&
                        isComplete == that.isComplete &&
                        isOverdue == that.isOverdue &&
                        subjectLifeCycle == that.subjectLifeCycle &&
                        sourceTypeCode == that.sourceTypeCode &&
                        taskDesc == that.taskDesc &&
                        arrangeSubjectId == that.arrangeSubjectId &&
                        arrangeSubjectTypeCode == that.arrangeSubjectTypeCode &&
                        receiveSubjectId == that.receiveSubjectId &&
                        coordObjectId == that.coordObjectId &&
                        stateCode == that.stateCode &&
                        completeStatus == that.completeStatus &&
                        oriPlanStartTime == that.oriPlanStartTime &&
                        oriPlanEndTime == that.oriPlanEndTime &&
                        taskType == that.taskType &&
                        createInductionId == that.createInductionId
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                taskId,
                taskNumber,
                taskName,
                planStartTime,
                planEndTime,
                deflectionInfo,
                percentageProgress,
                totalLength,
                relevantPeopleNum,
                orderNumber,
                operateTime,
                createTime,
                deflectionTime,
                taskStatus,
                workTaskType,
                isComplete,
                isOverdue,
                subjectLifeCycle,
                sourceTypeCode,
                taskDesc,
                arrangeSubjectId,
                arrangeSubjectTypeCode,
                receiveSubjectId,
                coordObjectId,
                stateCode,
                completeStatus,
                oriPlanStartTime,
                oriPlanEndTime,
                taskType,
                createInductionId
        );
    }

}
